{% import 'Import/app_import.html.twig' as appImport %}

<button type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#modal{{ modalReference }}">
    {{ title }}
</button>

<div class="modal fade" id="modal{{ modalReference }}" tabindex="-1" role="dialog" aria-labelledby="modalLabel{{ modalReference }}" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content {{ theme_modal_content }}">
            <form action="{{ form_action }}">
                <div class="modal-header">
                    <h5 class="modal-title" id="modalLabel{{ modalReference }}">{{ title }}</h5>
                    <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="{{ 'cancel'|trans }}"></button>
                </div>
                <div class="modal-body text-left">
                    <p>
                        <strong>{{ 'index'|trans }}</strong><br>
                        {{ row.index }}
                    </p>
                    <p>
                        <strong>{{ 'shard'|trans }}</strong><br>
                        {{ row.number }}
                    </p>
                    <p>
                        <strong>{{ 'type'|trans }}</strong><br>
                        {% if row.isPrimary %}
                            {{ appImport.badge({'title': 'primary'|trans, 'context': 'true'}) }}
                        {% else %}
                            {{ appImport.badge({'title': 'replica'|trans, 'context': 'false'}) }}
                        {% endif %}
                    </p>
                    <p>
                        <strong>{{ 'state'|trans }}</strong><br>
                        {{ appImport.badge({'title': row.state|trans, 'context': row.state}) }}
                    </p>
                    {% block content %}
                    {% endblock %}
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ 'cancel'|trans }}</button>
                    <button type="submit" class="btn btn-primary">{{ 'confirm'|trans }}</button>
                </div>
            </form>
        </div>
    </div>
</div>
